<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>系统首页</title>
    <link rel="stylesheet" href="{$CSS}/bootstrap3.3.7.min.css">
    <style>
        em{
            font-size: 20px;
            color: red;
            vertical-align: middle;
            line-height: 20px;
            height: 20px;
            display: inline-block;
        }
        .mar{
            margin-right:10px
        }
        .pic{
        	float:none;margin-bottom:10px
        }
        .pic img{
        	width: 393px;
    		height: 75px;
    	}
    </style>
</head>
<body style="overflow-x:hidden;">
    <div style="padding:10px;border-bottom:1px solid #eee;font-size:15px;font-weight:700">新增代理&nbsp;&nbsp;[<a href="daililiebiao.html">代理管理</a>]</div>
    <div style="margin:40px auto;">
        <div class="bs-example" data-example-id="simple-horizontal-form">
            <form class="form-horizontal" method="post" action=""  id="regform">{tk()}{$user_agency->hidden('id')}
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>账号</label>
                    <div class="col-sm-3">
						{$user_agency->text('un','class="form-control"  placeholder="账号"')}
						<span class="help-inline"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>密码</label>
                    <div class="col-sm-3">
                        <!-- {$user_agency->text('pwd','class="form-control" placeholder="密码"')} -->
                        <input type="password" name="pwd" class="form-control" value="" placeholder="为空默认不修改密码" >
						<span class="help-inline"></span>
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>客户名称</label>
                    <div class="col-sm-3">
						   {$user_agency->text('name','class="form-control" placeholder="客户名称"')}
                    </div>
                </div>
				
				
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">代理级别</label>
                    <div class="col-sm-1">					
						{$user_agency->select($al_arr,'level','class="form-control"')}		
                    </div>
                </div>
			
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">客户地址</label>
                    <div class="col-sm-3">
						 {$user_agency->text('addr','class="form-control" placeholder="客户地址"')}
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">客户经理</label>
                    <div class="col-sm-3">
						{$user_agency->text('jingli','class="form-control" placeholder="客户经理"')}
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>联系人</label>
                    <div class="col-sm-3">
						 {$user_agency->text('lxr','class="form-control" placeholder="联系人"')}
						 <span class="help-inline"></span>
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">电话</label>
                    <div class="col-sm-3">
						   {$user_agency->text('tel','class="form-control" placeholder="电话"')}
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>手机号</label>
                    <div class="col-sm-3">
						 {$user_agency->text('telephone','class="form-control" placeholder="手机号"')}
						  <span class="help-inline"></span>
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">邮箱</label>
                    <div class="col-sm-3">
						 {$user_agency->email('email','class="form-control" placeholder="邮箱"')}
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">QQ</label>
                    <div class="col-sm-3">
						   {$user_agency->text('qq','class="form-control" placeholder="QQ"')}
                    </div>
                </div>
				{if $mu->isyg || $mu->isadmin}
				<!--<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">归属财务</label>
                    <div class="col-sm-1">					
						{$user_agency->select($cw,'cwid','class="form-control"')}						
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">归属客服</label>
                    <div class="col-sm-1">					
						{$user_agency->select($kf,'kfid','class="form-control"')}
                    </div>
                </div>-->
				{/if}
				{if $mu->isadmin}
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">所属业务(代理)</label>
                    <div class="col-sm-1">					
						{$user_agency->select($yw,'pid','class="form-control"')}
                    </div>
                </div>
				{/if}
				
                <div class="form-group">
                   <label for="inputPassword3" class="col-sm-2 control-label"></label>
                    <div class="col-sm-6">
						<input class="btn btn-success mar" type="hidden" name="action" value="add" />
                        <input class="btn btn-success mar" name="btnAdd" ID="btnAdd" onclick="registerUser()" type="button" class="button" value="提交">
                        <input class="btn btn-warning mar" name="reset" ID="Submit1" type="reset" value="重置">
                        <input class="btn btn-danger mar"  name="back" ID="back" type="button" onclick="history.back();" value="返回">
                        </div>
                </div>
				
            </form>
        </div>

    </div>
</body>

</html>
<script type="text/javascript">
	
	function registerUser(){  
		$('.help-inline').remove();
		$('font').css('display','none')
		$('#regform').validate(function(m){
		    if(m.length>0){
		        for(var i=0;i<m.length;i++){
		            //m[i].e为验证错误的表单元素
		            //m[i].m该单元的错误信息（非空错误为false，其他为信息数组）
		 			var ntip = $('<span class="help-inline" style="color:red">'+(m[i].m===false?'该项内容不能为空':m[i].m.join(','))+'</span>');
		            $(m[i].e).after(ntip.show());
		            $(m[i].e).one('blur',function(){
		            	ntip.remove();
		            });
		        }
		    }else{
		        $('form').submit();
		    }
		});
	}
</script>